﻿using System;
using XcoAppSpaces.Core.Ports.Utils;

namespace XcoAppSpaces.Core.Ports.Remoting
{
	/// <summary>
	/// This interface is implemented by port classes, to allow the definition of an action to bypasses most of the normal port logic
	/// (used in the appspace for remote communication).
	/// </summary>
	public interface IPortBypass
	{
		/// <summary>
		/// Registers a receiver that bypasses most of the normal port logic (like exception handling), and allows direct access to the PortElement instance.
		/// </summary>
		/// <param name="bypassAction">The action to be called.</param>
		/// <param name="options">Receiver options.</param>
		void RegisterBypassReceiver(Action<IPort, IPortElement> bypassAction, PortReceiverOptions options);
	}
}